package com.fruit.mapper.shopping;

import java.util.List;

import com.fruit.pojo.shopping.Shopping;

public interface ShoppingMapper {

	/**
	 * 查询购物车列表
	 * @param userId
	 * @return
	 * @author admin
	 * @version 2017
	 */
	List<Shopping> getShoppingList(int userId);
	
	/**
	 * 查询购物车数量
	 * @param userId
	 * @return
	 * @author admin
	 * @version 2017
	 */
	int getShoppingCnt(int userId);
	
	/**
	 * 查询购物车商品数量
	 * @param userId
	 * @return
	 * @author admin
	 * @version 2017
	 */
	int getShoppingNumber(int userId);

	/**
	 * 查询购物车列表
	 * @param userId
	 * @param ids
	 * @return
	 * @author admin
	 * @version 2017
	 */
	List<Shopping> getShoppingListByIds(Shopping shopping);	
	
	/**
	 * 查寻购物车详情
	 * @param id
	 * @return
	 * @author admin
	 * @version 2017
	 */
	Shopping getShoppingById(long id);
	
	/**
	 * 修改购物车数量
	 * @param params
	 * @return
	 * @author admin
	 * @version 2017
	 */
	int updateShoppingNum(Shopping shopping);
	
	/**
	 * 通过商品ID用户ID 获取购物车
	 * @param shopping
	 * @return
	 * @author admin
	 * @version 2017
	 */
	Shopping getShoppingByGId(Shopping shopping);
	
	/**
	 * 添加购物车
	 * @param shopping
	 * @return
	 * @author admin
	 * @version 2017
	 */
	int addShopping(Shopping shopping);
	
	/**
	 * 删除购物车
	 * @param shopping
	 * @return
	 * @author admin
	 * @version 2017
	 */
	int delShopping(Shopping shopping);
}
